﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Pager.ascx.cs" Inherits="Ones.Utils.UserControls.Pager" %>

<ul class="pagination no-margin">
    <%if (HasPreviousPage)
    {
            %>
            <li>
                <a href="<%=Url %>?p=<%=PageNumber - 1 %>">Previous</a>
            </li>
            <% 
    }
    else
    { %>
        <li class="disabled">
            <a>Previous</a>
        </li>
        <%
    }%>
    
    <%for (int i = 1; i <= TotalPages; i++)
    {
            %>
            <li>
                <a href="<%=Url %>?p=<%=i %>"><%=i %></a>
            </li>
            <% 
    }%>
    
    <%if (HasNextPage)
    {
            %>
            <li>
                <a href="<%=Url %>?p=<%=PageNumber + 1 %>">Next</a>
            </li>
            <% 
    }
    else
    { %>
            <li class="disabled">
                <a>Next</a>
            </li>
        <%
    }%>
</ul>